<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>用户列表-增加</title>
	<link rel="stylesheet" type="text/css" href="../resource/css/base.css" />
	<script type="text/javascript" src="../resource/js/My97DatePicker/WdatePicker.js"></script>
	<s:actionmessage/>
	<script type="text/javascript">
		function doSumbit(){
			var form = document.forms[0];
			var reg = /^[a-zA-Z0-9_]{1,15}$/;
			if(!reg.test(form.username.value)){
				alert("用户名格式错误,请重新输入.");
				return false;
			}
			if(form.phone.value==""){
				alert("请输入用户联系电话.");
				return false;
			}
			if(form.loginType.value==""){
				alert("请选择用户类型.");
				return false;
			}
			form.action="add.action";
			form.submit();
		}
	</script>
</head>
<body  oncontextmenu="return false;" leftmargin="8" topmargin="8">
<div class="tip"><span>当前位置:</span>用户管理&nbsp;&gt;&nbsp;新增&nbsp;&gt;&nbsp;</div>
<s:form name="add" namespace="/user">
<table class="edittb" cellpadding="2" cellspacing="1">
	<tr bgcolor="#EEF4EA">
		<td height="35" colspan="4">&nbsp;用户信息&nbsp;</td>
	</tr>
	<tr>
		<td  class="coln"><SPAN style="color: red">*</SPAN> 用户名(字母、数字)</td>
		<td  width="1"  class="colv">
			<s:textfield name="username" ></s:textfield>
		</td>
		<td class="coln"><SPAN style="color: red">*</SPAN> 联系电话</td>
		<td  class="colv">
			<s:textfield name="phone"></s:textfield>
		</td>	
	</tr>
	<tr>
		<td class="coln"> 性别</td>
		<td width="45%" class="colv">
			<s:select list="#{1:'男',0:'女'}" listKey="key" listValue="value" name="sex" cssStyle="width:80%;"></s:select>
		</td>
		<td class="coln"> 出生年份</td>
		<td class="colv">
			 <s:textfield onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy'})"  cssClass="Wdate" name="yobbo"></s:textfield>
		</td>
	</tr>
	<tr>
		<td class="coln"><SPAN style="color: red">*</SPAN> 用户类型</td>
		<td  class="colv">
			<s:select list="#{1:'录入员',0:'管理员'}" listKey="key" listValue="value" name="loginType" cssStyle="width:80%;"></s:select>
		</td>
		<td class="coln">用户初始密码(123456)</td>
		<td  class="colv">
			<s:password name="password" value="123456"/>
		</td>
	</tr>
	<tr align="right" bgcolor="#EEF4EA">
		<td height="35" colspan="4" align="center">
			<a href="javascript:history.go(-1)" class="coolbg">&nbsp;返&nbsp;回&nbsp;</a>
			<a href="#" class="coolbg" onclick="return doSumbit();">&nbsp;保&nbsp;存&nbsp;</a>
			<a href="javascript:document.forms[0].reset()" class="coolbg">&nbsp;重&nbsp;置&nbsp;</a>
		</td>
	</tr>
</table>
</s:form>
</body>
</html>
